const express = require('express');
const app = express();

//配置跨域
const cors = require('cors');
app.use(cors());


const bodyParser = require('body-parser');
app.use(express.urlencoded({ extended: false }));
app.use(bodyParser.json());

//引入登录注册模块admin.js
const users = require('./routes/api/admin');
app.use('/api/admin', users);
// 引入用户信息路由模块userinfo.js
const userInfo = require('./routes/api/userinfo');
app.use('/api/userinfo', userInfo);
//引入商品流水模块mall.js
const Mall = require('./routes/api/mall');
app.use('/api/mall', Mall);


app.get('/', (req, res) => {
    res.send('Hello World');
})



const port = process.env.PORT || 3000;

app.listen(port, () => {
    console.log(`Server running on port ${port}`);
})